import { convertToRgb } from '@vben-core/shared/color';
// 引入颜色转换函数
const appName = import.meta.env.VITE_APP_NAME;
/**
 * 获取css变量值
 * @param variable
 * @param isColor
 * @returns string
 */
export const getCssVariableValue = (
  variable: string,
  isColor: boolean = true,
) => {
  const rootStyles = getComputedStyle(document.documentElement);
  const value = rootStyles.getPropertyValue(variable);
  return isColor ? convertToRgb(`hsl(${value})`) : value;
};

export const getAppName = () => {
  // if(import.meta.env.VITE_APP_NAME)
  return appName;
};
